package cn.net.yato.picture.config.shiro;
 
import org.apache.shiro.authc.HostAuthenticationToken;
import org.apache.shiro.authc.RememberMeAuthenticationToken;
 
/**
 * @author yato
 */
public class PhoneAndVerificationCodeToken implements HostAuthenticationToken, RememberMeAuthenticationToken {
   private String phone;
   private boolean rememberMe;
   private String host;

   public PhoneAndVerificationCodeToken(String phone){
       this(phone,false,null);
   }


    public PhoneAndVerificationCodeToken(String phone,boolean rememberMe){
        this(phone,rememberMe,null);
    }

    public PhoneAndVerificationCodeToken(String phone,boolean rememberMe,String host){
        this.phone=phone;
        this.rememberMe=rememberMe;
        this.host=host;
    }
    @Override
    public String getHost() {
        return host;
    }

    @Override
    public boolean isRememberMe() {
        return rememberMe;
    }

    @Override
    public Object getPrincipal() {
        return phone;
    }

    @Override
    public Object getCredentials() {
        return phone;
    }

}